<?php
require_once("rpcl/rpcl.inc.php");
require_once("config/data.php");
//Includes
use_unit("forms.inc.php");
use_unit("extctrls.inc.php");
use_unit("stdctrls.inc.php");
use_unit("comctrls.inc.php");

//Class definition
class sxbg extends Page
{
    public $ComboBoxsxcj = null;
    public $Panelsxbgbody = null;
    public $labelsxcj = null;
    public $LabelSxmb = null;
    public $LabelSxsb = null;
    public $LabelSxnr = null;
    public $MemoSxmb = null;
    public $MemoSxsb = null;
    public $MemoSxnr = null;
    public $LabelQuestiion = null;
    public $LabelSxzj = null;
    public $MemoSxzj = null;
    public $MemoSxwt = null;
    public $PanelSybgTitle = null;
    public $LabelStudentName = null;
    public $LabelSxxm = null;
    public $LabelStudentClass = null;
    public $LabelStudentProf = null;
    public $LabelXueKe = null;
    public $LabelTeacherName = null;
    public $LabelTjrq = null;
    public $HiddenFieldReportId = null;
    function sxbgBeforeShow($sender, $params)
    {
     global $dzsxDB;
     if(!isset($_SESSION['TeacherId']))
        redirect("index.php");
      else
        $v=$_SESSION['TeacherId'];

     if(isset($_GET['RepScoreId']))
       {
        $RepScoreId=$_GET['RepScoreId'];
        $this->HiddenFieldReportId->value=$RepScoreId;
       }
     else
       echo "<script>alert('无报告编号');</script>";

     $this->Panelsxbgbody->Width='820';
     $this->Panelsxbgbody->Height='550';
     $this->PanelSybgTitle->Width='805';
     $this->PanelSybgTitle->Height='67';

     //查询数据库中实训报告视图
     $dzsxDB->QuerySxbgScore->Active=False;
     $dzsxDB->QuerySxbgScore->SQL="Select * From sxbglist Where ReportId='$RepScoreId'";
     $dzsxDB->QuerySxbgScore->Active=True;
     //实训报告内容初始化
     $this->LabelSxxm->caption="实训项目：".$dzsxDB->QuerySxbgScore->ExpName;
     $this->LabelTjrq->caption="提交日期：".$dzsxDB->QuerySxbgScore->tjrq;
     $this->LabelStudentName->caption="姓名：".$dzsxDB->QuerySxbgScore->StudentName;
     $this->LabelStudentClass->caption="班级：".$dzsxDB->QuerySxbgScore->ClassName;
     $this->LabelStudentProf->caption="专业：".$dzsxDB->QuerySxbgScore->ProfName;
     $this->LabelXueKe->caption="学科：".$dzsxDB->QuerySxbgScore->CourseName;
     $this->LabelTeacherName->caption="指导教师：".$dzsxDB->QuerySxbgScore->TeacherName;
     $this->MemoSxmb->text=$dzsxDB->QuerySxbgScore->sxmb;
     $this->MemoSxsb->text=$dzsxDB->QuerySxbgScore->sxsb;
     $this->MemoSxnr->text=$dzsxDB->QuerySxbgScore->ExpContent;
     $this->MemoSxwt->text=$dzsxDB->QuerySxbgScore->sxwt;
     $this->MemoSxzj->text=$dzsxDB->QuerySxbgScore->sxzj;
     $sxcj=$dzsxDB->QuerySxbgScore->sxcj;
     $this->ComboBoxsxcj->ItemIndex=$sxcj;
   }

   function ComboBoxsxcjJSChange($sender, $params)
    {
        ?>
        //begin js
         params=document.getElementById("ComboBoxsxcj").value;
        //end
        <?php
        echo $this->ComboBoxsxcj->ajaxcall("sxpj");
    }
   function sxpj($sender,$params)
    {
     global $dzsxDB;
     $sxpj=$params;
     $sxpjid=$this->HiddenFieldReportId->value;
     $dzsxDB->QueryUpdateSxpj->Active=Fasle;
     $dzsxDB->QueryUpdateSxpj->SQL="UPDATE expreport SET sxcj='$sxpj' Where ReportId='$sxpjid'";
     $dzsxDB->QueryUpdateSxpj->Active=True;
    }

}

global $application;

global $sxbg;

//Creates the form
$sxbg=new sxbg($application);

//Read from resource file
$sxbg->loadResource(__FILE__);

//Shows the form
$sxbg->show();

?>